package com.zhaosc.configbean;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import com.zhaosc.registry.BaseRegistry;

public class Registry extends BaseConfigBean implements InitializingBean,ApplicationContextAware{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7340818620613477657L;

	public ApplicationContext application;
	
	private static Map<String,BaseRegistry> registryMap=new HashMap<String, BaseRegistry>();
	
	static{
		registryMap.put("redis", null);
	}
	
    private String protocol;
    
    private String address;
    
    
	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.application = applicationContext;
		
	}

	public static Map<String, BaseRegistry> getRegistryMap() {
		return registryMap;
	}

	public static void setRegistryMap(Map<String, BaseRegistry> registryMap) {
		Registry.registryMap = registryMap;
	}

}
